﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Domain;
using System.Collections;

namespace Shop.Persistence
{
    public class UserInfoSqlMapDao:BaseSqlMapDao
    {
        public UserInfoSqlMapDao()
        {
        }
        public UserInfo GetUserInfoDo(string Id)
        {
            UserInfo deptOrg = this.ExecuteQueryForObject<UserInfo>("SelectUserInfo", Id);
            return deptOrg;
        }

        public IList<UserInfo> GetUserInfoList()
        {
            return this.ExecuteQueryForList<UserInfo>("SelectUserInfo", null);
        }

        public IList<UserInfo> NoQueryForListByPage(int skipResults, int maxResults)
        {
          
           return this.ExecuteQueryForList<UserInfo>("SelectUserInfo", null, skipResults, maxResults);
          
            
        }

        public void InsertRecord(UserInfo UserInfo)
        {
            this.ExecuteInsert("InsertUserInfo", UserInfo);
        }

        public void DeleteRecord(string ID)
        {
            this.ExecuteDelete("DeleteUserInfo",ID);
        }

        public void UpdateRecord(UserInfo UserInfo)
        {
            this.ExecuteUpdate("UpdateUserInfo",UserInfo);
        }

        public IList<UserInfo> DynamicQuery(string Field, string Operator, string Value,int skipResults, int maxResults)
        {
            Hashtable ht = new Hashtable();
            ht.Add("Field", Field);
            ht.Add("Operator", Operator);
            ht.Add("Value", Value);
            return this.ExecuteQueryForList<UserInfo>("DynamicQuery", ht, skipResults, maxResults);
        }       
    }
}
